// import { login, getUserInfo } from '../services/home';

// mock tableListDataSource
const tableListDataSource = []
const streeArray = ['西乡', '宝安', '龙岗', '南山']
for (let i = 0; i < 300; i += 1) {
  tableListDataSource.push({
    key: i,
    isabled: i % 6 === 0,
    href: 'https://ant.design',
    avatar: [
      'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
      'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
    ][i % 2],
    name: `深圳市${i} ${i}有限公司`,
    title: `一个任务名称 ${i}`,
    numble: Math.floor(Math.random() * 100),
    people: '菱歌科技',
    phone: '18888888',
    owner: '曲丽丽',
    desc: `${streeArray[Math.floor((Math.random() * 3))]}街道`,
    type: `数字${i} ${i}行业`,
    callNo: Math.floor(Math.random() * 1000),
    status: Math.floor(Math.random() * 9),
    updatedAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`),
    createdAt: new Date(`2017-07-${Math.floor(i / 2) + 1}`),
    progress: Math.ceil(Math.random() * 100),
  });
}

const initState = {
    tableListDataSource: []
}


const Model = {
  namespace: 'formAndbasicForm',

  state: {
    initState,
  },

  effects: {
    // eslint-disable-next-line require-yield
    *getBasicForm({ payload }, { call, put }) {

        yield put({
            type: 'save',
            payload: { tableListDataSource },
        });
        // return tableListDataSource
        return Promise.resolve(tableListDataSource)
        

    },
  },

  reducers: {
    save(state, { payload }) {
        return { ...state, ...payload };
    }
  },
};
export default Model;
